home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9934 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.2 KB  |  59 lines

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: HELP NEEDED..Please no Sermons
  5. Date: 14 Mar 1996 07:40:44 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4i9elsINN7ss@keats.ugrad.cs.ubc.ca>
  8. References: <4i7th3$c9@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4i7th3$c9@newsbf02.news.aol.com>,
  12. MackBoring <mackboring@aol.com> wrote:
  13.  >****** PLEASE DO NOT REPLY WITH SPEECHES OR NASTY POSTS************
  14.  >First please read at least this short paragraph.
  15.  > Iam a student that is desperately in a hole. I am not wishing to cheat my
  16.  >self out of an education of C , but...I have a scenario.  I am recently a
  17.  >new farther (4 week old boy) and have enrolled in this C class and am
  18.  
  19. Still four weeks like two weeks ago, eh? ;)
  20.  
  21.  >7.Write aprogram to compute farenheit to celsius temperature. The table
  22.  >should run from -40 to 220 degrees farenheit in signle degree
  23.  >intervals.Show farenheit as an integer and celsius as a float. Conversion
  24.  >formula is..................... C=(5/9)*(F-32)
  25.  
  26. This program is implemented in the Kernighan and Ritchie book which you should
  27. have if you are learning C.
  28.  
  29.  >8. Write a program using a contigous numerical sequence, to print a
  30.  >listing of all possible arragments of the digits 000  thru 999 three
  31.  >digits at a time for example 000,001,002....998,999
  32.  
  33. for(i=0;i<1000;i++) printf("%03d\n",i);
  34.  
  35.  >9. Access the clock display the time on the screen( e.g 14.20.33). Now
  36.  >translate the time into printed words and display that on screen. Noon and
  37.  >midnight should be so named .
  38.  
  39. #include <time.h>
  40. #include <stdio.h>
  41. .
  42. .
  43. .
  44.     char str[20];
  45.  
  46.     strftime(str,20,"%H.%M.%S",localtime(NULL));
  47.  
  48.     puts(str);
  49.  
  50.  >************************************* Ifpossible create a  loop(for a set
  51.  >period of time or until a key is pressed) displaying the time  each time
  52.  >through the loop. If possible set  an alarm to beep at a given (requested)
  53.  >time. If you want to show(translate into words) the seconds.
  54.  
  55. You are taking a hokey course.  Methods for detecting a keystroke are
  56. platform-specific, not a part of the C language.
  57. -- 
  58.  
  59.